# flake8: NOQA

print("--------摇钱树--------")
N=input("请输入高度：")
n=int(N)
def plant(n):
    for i in range(n):
        if i>int(n/2):
            print(" "*(n-i+2)+"$"*(2*i-3)+" "*(n-i+2))
            if i==n-1:
                j=(n-i+2)+int((2*i-6)/2)
                print(" "*j+"|"+" "*1+"|"+" "*j)
            
        else:
            print(" "*(n-i)+"$"*(2*i+1)+" "*(n-i))
plant(n)